#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=100010;
int n,r[N];
int h[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    cin>>n;
    int maxn=0;
    for(int i=1;i<=n;i++){
        cin>>r[i];h[r[i]]++;
        maxn=max(maxn,r[i]);
    }
    int sum=0,ans=0;
    for(int i=1;i<=maxn;i++){
        ans+=min(sum,h[i]);
        sum-=min(sum,h[i]);
        sum+=h[i];
    }
    cout<<n-ans<<endl;
    return 0;
}
//100